<{include file="../templates/admin/header.html"}>
<script type="text/javascript" src="../js/jquery.js">
</script>
<script type="text/javascript" src="js/attr_oper.js">
</script>
<script type="text/javascript">
function charea(a) {
    var spans = ['general','detail','mix','properties'];
    for(i=0;i<4;i++) {
        var o = document.getElementById(spans[i]+'-tab');
        var tb = document.getElementById(spans[i]+'-table');
        o.className = o.id==a+'-tab'?'tab-front':'tab-back';
        tb.style.display = tb.id==a+'-table'?'block':'none';
    }
    
}
</script>

<!-- start goods form -->
<div class="tab-div">
    <!-- tab bar -->
    <div id="tabbar-div">
      <p>
        <span class="tab-front" id="general-tab" onclick="charea('general');">通用信息</span>
        <span class="tab-back" id="detail-tab" onclick="charea('detail');">详细描述</span>
        <span class="tab-back" id="mix-tab" onclick="charea('mix');">其它信息</span>
		<span class="tab-back" id="properties-tab" onclick="charea('properties');">商品属性</span>		
      </p>
    </div>

    <!-- tab body -->
    <div id="tabbody-div">
      <form enctype="multipart/form-data" action="goods.php?act=update" method="post" name="theForm" >

        <input type="hidden" name="MAX_FILE_SIZE" value="2097152" />

        <table width="90%" id="general-table" align="center">
          <tr>
            <td class="label">商品名称：</td>
            <td><input type="text" name="goods_name" value="<{$row.goods_name}>" style="float:left;color:;" size="30" /></td>
          </tr>
          <tr>
            <td class="label">商品分类：</td>
            <td>
            
            <select name="cat_id">
	        <option value="0">请选择...</option>
	        <{foreach from=$cat_list item=list}>
	        <option value="<{if $list.cat_id eq $row.cat_id}><{$list.cat_id}>" selected="selected"<{else}><{$list.cat_id}><{/if}>"><{if $list.lev eq 2}>&nbsp;&nbsp;<{/if}><{if $list.lev eq 3}>&nbsp;&nbsp;&nbsp;&nbsp;<{/if}><{$list.cat_name}></option>
	        <{/foreach}>
	        </select>
	        
             </td>
          </tr>
		  <tr>
            <td class="label">提供商家：</td>
            <td>
            <select name="mer_id">
                        <option value="0" selected="selected" >请选择商家...</option>
                        <{foreach from=$merList item=list}>
	        			<option value="<{if $list.mer_id eq $row.mer_id}><{$list.mer_id}>" selected="selected"<{else}><{$list.mer_id}><{/if}>"><{$list.mername}></option>
                        <{/foreach}>
		    </select>
             </td>
          </tr>
          <tr>
            <td class="label">市场价：</td>
            <td><input type="text" name="market_price" value="<{$row.market_price}>" size="20" /></td>
          </tr>
          <tr>
            <td class="label">本店售价：</td>
            <td><input type="text" name="shop_price" value="<{$row.shop_price}>" size="20" /></td>
          </tr>
          
          <tr>
            <td class="label">上传商品图片：</td>
            <td>
              <input type="file" name="ori_img" size="35" />
            </td>
          </tr>
        </table>

        <!-- 详细描述 -->
        <table width="90%" id="detail-table" style="display:none">
          <tr>
            <td><textarea name="goods_desc" ></textarea></td>
          </tr>
        </table>

        <!-- 其他信息 -->
        <table width="90%" id="mix-table" style="display:none" align="center">
          <tr>
            <td class="label"><a href="#" title="点击此处查看提示信息"><img src="./images/notice.gif" width="16" height="16" border="0" alt="点击此处查看提示信息"></a>商品库存数量</td>

            <td><input type="text" name="goods_number" value="<{$row.goods_number}>" size="20" />
          </tr>
          <tr>
            <td class="label">加入推荐：</td>
            <td><input type="checkbox" name="is_best" value="1" <{if $row.is_best eq 1}>checked="checked"<{/if}> />精品<input type="checkbox" name="is_new" value="1" <{if $row.is_new eq 1}>checked="checked"<{/if}> />新品 <input type="checkbox" name="is_hot" value="1" <{if $row.is_hot eq 1}>checked="checked"<{/if}> />热销</td>
          </tr>
          <tr id="alone_sale_1">
            <td class="label" id="alone_sale_2">上架：</td>
            <td id="alone_sale_3"><input type="checkbox" name="is_on_sale" <{if $row.is_on_sale eq 1}> value="1" checked="checked"<{else}> value="0" <{/if}> />打勾表示允许销售，否则不允许销售。</td>
          </tr>
          <tr>
            <td class="label">商品关键词</td>
            <td><input type="text" name="keywords" value="<{$row.goods_desc}>" size="40" />用空格隔开</td>
          </tr>
          <tr>
            <td class="label">商品简单描述</td>
            <td><textarea name="goods_brief" cols="20" rows="5"></textarea></td>
          </tr>
        </table>
        	
		<!-- 商品属性 -->
        <table width="90%" id="properties-table" style="display:none" align="center">
          <tr id="location">
              <td class="label">商品类型：</td>
              <td>
               	<select name="cat_id" onchange="attr(this)">
		        <option value="0">请选择...</option>
		        <{foreach from=$cat_list2 item=list}>
		        <option value="<{$list.cat_id}>" <{if $list.cat_id eq $row.cat_id}> selected="selected"<{/if}> ><{$list.cat_name}></option>
		        <{/foreach}>
		        </select>
		      </td>
          </tr>
        </table>
        
  
        <div class="button-div">
          <input type="hidden" name="act" value="insert" />
          <input type="hidden" name="goods_id" value="<{$row.goods_id}>" />
          <input type="submit" value="确定" class="button" />
          <input type="reset" value="重置" class="button" />
        </div>
      </form>
    </div>
</div>
<!-- end goods form -->

</body>
</html>